package cn.sdstudio.service.impl;

import cn.sdstudio.entity.Collect;
import cn.sdstudio.entity.RelicSite;
import cn.sdstudio.vo.FavoriteVO;
import cn.sdstudio.vo.RelicSiteVO;
import cn.sdstudio.mapper.RelicSiteMapper;
import cn.sdstudio.service.RelicSiteService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RelicSiteServiceImpl extends ServiceImpl<RelicSiteMapper, RelicSite> implements RelicSiteService {
    @Autowired
    RelicSiteMapper relicSiteMapper;

    @Override
    public Page<RelicSiteVO> getRemainsUserPageVo(Page<RelicSiteVO> iPage) {
        return relicSiteMapper.getRemainsUserPageVo(iPage);
    }

    @Override
    public Page<RelicSite> getRemainsPageVo(Page<RelicSite> iPage) {
        return relicSiteMapper.getRemainsPageVo(iPage);
    }

    @Override
    public int addCollect(Collect collect) {
        return relicSiteMapper.addCollect(collect);
    }

    @Override
    public List<FavoriteVO> getMyCollect(int userid) {
        return relicSiteMapper.getMyCollect(userid);
    }

    @Override
    public int deleteFavorite(int id,int userid) {
        return relicSiteMapper.deleteFavorite(id,userid);
    }

    @Override
    public List<RelicSite> selectList(String content) {
        return relicSiteMapper.searchByTitle(content);
    }

    @Override
    public List<RelicSite> searchByTitle(String content) {
        return null;
    }

}
